/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.WorkgroupDao;
import com.rbh.risk.entity.Workgroup;
import com.rbh.risk.service.WorkgroupService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("workgroupService")
public class WorkgroupServiceImpl implements WorkgroupService {

    @Autowired
    private WorkgroupDao workgroupDao;
    
    @Transactional(readOnly = false)
    @Override
    public void insert(Workgroup workgroup) {
        this.workgroupDao.insert(workgroup);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(Workgroup workgroup) {
        this.workgroupDao.update(workgroup);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(Workgroup workgroup) {
        this.workgroupDao.delete(workgroup);
    }

    @Transactional(readOnly = true)
    @Override
    public Workgroup getById(Integer workgroupId) {
        return this.workgroupDao.getById(workgroupId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Workgroup> getAll() {
        return this.workgroupDao.getAll();
    }

    @Transactional(readOnly = true)
    @Override
    public List<Workgroup> getChildWorkgroup() {
        return this.workgroupDao.getChildWorkgroup();
    }

    @Transactional(readOnly = true)
    @Override
    public List<Workgroup> getByWords(String words) {
        return this.workgroupDao.getByWords(words);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Workgroup> getByNotEqWords(String words, Workgroup workgroup) {
        return this.workgroupDao.getByNotEqWords(words, workgroup);
    }
}
